home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / TreeView / NamedTree.m < prev    next >
Text File  |  1995-06-12  |  1KB  |  39 lines

  1. //
  2. //    NamedTree.m -- a generic class to build tree data structures
  3. //        This class requires the String class, also by Don Yacktman.
  4. //        Written by Don Yacktman (c) 1993 by Don Yacktman.
  5. //                All rights reserved.
  6. //
  7. //        You may use and copy this class freely as long as you
  8. //        comply with the following terms:
  9. //            (1) If you use this class in an application which you
  10. //                intend to sell commercially, as shareware, or otherwise,
  11. //                you may only do so with express written permission
  12. //                of the author.  Use in applications which will
  13. //                be distributed free of charge is encouraged.
  14. //            (2) You must include the source code to this object and
  15. //                all accompanying documentation with your application,
  16. //                or provide it to users if requested, free of charge.
  17. //            (3) Do not remove the author's name or any of the
  18. //                copyright notices
  19. //
  20.  
  21. #import "NamedTree.h"
  22.  
  23. @implementation NamedTree
  24.  
  25. - setTreeName:string { treeName = string; return self; }
  26. - (const char *)treeName { return [treeName stringValue]; }
  27.  
  28. - activateNode:sender
  29. {    // this action message is sent whenever the button associated with
  30.     // this node is clicked by the user.  Right now, we just print out
  31.     // the tree's name and the node's name to stdout (which will show
  32.     // up in the console.)  This basically just proves that the message
  33.     // was actually sent; in a real app, this would do something useful.
  34.     printf("%s^^%s\n", [self treeName], [self label]);
  35.     return self;
  36. }
  37.  
  38. @end
  39.